//地图驾车
import React, { Component } from 'react';
import {
    View,
    Text,
} from 'react-native';


import { mapcarStyle as styles } from '../../../styles';
import { RouteModule } from 'rn-ai-baidu-map';

var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;
import Car_list from './carlist';
import Car_route from './carroute';

// const mWidth = -450
export default class Mapcar extends Component {
    constructor(props) {
        super(props)
        this.state = {
            theLine: 0
        }
    }

    _setLine(index) {
        RouteModule.toNavigation("jc", index);
        this.setState({
            theLine: index
        })
    }
    render() {
        return (
            <View style={{flex:1}}>
                <Car_list Lines={this.props.Lines} theLine={this.state.theLine} callBack={this._setLine.bind(this)}/>
                    <Text style={styles.carmore}>路线详情</Text>
                    <Car_route Line={this.props.Lines[this.state.theLine]}  />
            </View>
        )
    }

}